package com.yanshibo.dao;

import java.util.List;

import org.apache.ibatis.annotations.Select;

import com.github.pagehelper.PageInfo;
import com.yanshibo.bean.Dormitory;
import com.yanshibo.bean.Floor;
import com.yanshibo.bean.QueryVo;
import com.yanshibo.bean.User;

public interface DormitoryDao {

	List<Dormitory> getDormitoryList(QueryVo vo);

	@Select("SELECT * FROM `floor`")
	List<Floor> getFool();

	@Select("SELECT * FROM `user` ")
	List<User> getUserList();

	@Select("SELECT * FROM `dormitory` ")
	List<Dormitory> getDormitory();

	@Select("SELECT * FROM `dormitory` where fid=#{fid}")
	List<Dormitory> erji(Integer fid);

	
	Dormitory sanji(Integer did);
	
	@Select("SELECT * FROM `user` WHERE uname =#{uname} AND pwd=#{pwd}")
	User login(User user);
	
	@Select("SELECT a.*,c.dname FROM `user` a LEFT JOIN record b ON a.uid=b.uid LEFT JOIN dormitory c ON b.did=c.did having uid=5")
	List<User> selects();
	
	@Select("SELECT a.*,c.uname unames,b.int_time,b.out_time FROM dormitory a LEFT JOIN record b ON a.did=b.did LEFT JOIN `user` c ON b.uid=c.uid")
	List<Dormitory> listDor();

}
